#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1e9+7;
const int N=1e5+5;
int x,y,f[N];
signed main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>x>>y;
	f[x]=1;
	for(int i=x;i<=y;i++) {
		if(i*2<=y) f[i*2]=(f[i*2]+f[i])%mod;
		if(i+1<=y) f[i+1]=(f[i+1]+f[i])%mod;
	}
	cout<<f[y];
	return 0;
}

